package com.itheima.mapper;

import com.itheima.entity.EmpParam;
import com.itheima.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface StudentMapper {
    //学员列表查询
    List<Student> getListStudent(EmpParam empParam);
    //根据id批量删除学员
    void deleteStudents(List<Integer> ids);
    //添加学员信息
    void addSyudent(Student student);
    //根据id查询学员信息
    Student getStudentById(Integer id);
    //编辑学员信息
    void updateStudent(Student student);
    //学员违纪操作
    @Options(useGeneratedKeys = true)
    @Update("update student set violation_score=#{score},violation_count=#{count} where id=#{id}")
    void violation(Integer id, Integer score, Short count);
}
